<?php

/*
|--------------------------------------------------------------------------
| Register The Laravel Class Loader
|--------------------------------------------------------------------------
|
| In addition to using Composer, you may use the Laravel class loader to
| load your controllers and models. This is useful for keeping all of
| your classes in the "global" namespace without Composer updating.
|
*/

ClassLoader::addDirectories(array(

	app_path().'/commands',
	app_path().'/controllers',
	app_path().'/models',
	app_path().'/database/seeds',

));

/*
|--------------------------------------------------------------------------
| Application Error Logger
|--------------------------------------------------------------------------
|
| Here we will configure the error logger setup for the application which
| is built on top of the wonderful Monolog library. By default we will
| build a rotating log file setup which creates a new file each day.
|
*/

$logFile = 'log-'.php_sapi_name().'.txt';

Log::useDailyFiles(storage_path().'/logs/'.$logFile);

/*
|--------------------------------------------------------------------------
| Application Error Handler
|--------------------------------------------------------------------------
|
| Here you may handle any errors that occur in your application, including
| logging them or displaying custom views for specific errors. You may
| even register several error handlers to handle different types of
| exceptions. If nothing is returned, the default error view is
| shown, which includes a detailed stack trace during debug.
|
*/

App::error(function(Exception $exception, $code)
{
	Log::error($exception);
});

/*
|--------------------------------------------------------------------------
| Maintenance Mode Handler
|--------------------------------------------------------------------------
|
| The "down" Artisan command gives you the ability to put an application
| into maintenance mode. Here, you will define what is displayed back
| to the user if maintenace mode is in effect for this application.
|
*/

App::down(function()
{
	return Response::make("Be right back!", 503);
});

/*
|--------------------------------------------------------------------------
| Require The Filters File
|--------------------------------------------------------------------------
|
| Next we will load the filters file for the application. This gives us
| a nice separate location to store our route and application filter
| definitions instead of putting them all in the main routes file.
|
*/

require app_path().'/filters.php';
/*
// Define the Basset collection
Basset::collection('manager', function($collection)
{
    // CSS
    $collection->add('../public/css/bootstrap.min.css');
    $collection->add('../public/css/font-awesome.css')->apply('CssMin');
    $collection->add('../public/css/jquery.fileupload.css');

    // Custom CSS
    $collection->add('../public/css/manager.css')->apply('CssMin');

    // jQuery
    $collection->add('../public/js/jquery-1.9.1.min.js')->apply('JsMin');
    $collection->add('../public/js/jquery-ui-1.10.3.custom.min.js')->apply('JsMin');
    $collection->add('../public/js/jquery.livequery.min.js');
    $collection->add('../public/js/jquery.equalheights.js')->apply('JsMin');
    $collection->add('../public/js/jquery.form.min.js')->apply('JsMin');
    $collection->add('../public/js/jquery.nestedSortable.js')->apply('JsMin');
	$collection->add('../public/js/jquery.iframe-transport.js')->apply('JsMin');
	$collection->add('../public/js/load-image.min.js')->apply('JsMin');
	$collection->add('../public/js/canvas-to-blob.min.js')->apply('JsMin');
	$collection->add('../public/js/jquery.fileupload.js')->apply('JsMin');
	$collection->add('../public/js/jquery.fileupload-process.js')->apply('JsMin');
	$collection->add('../public/js/jquery.fileupload-image.js')->apply('JsMin');
	$collection->add('../public/js/jsviews.min.js');
	
    // Bootstrap
    $collection->add('../public/js/bootstrap.min.js')->apply('JsMin');

    // Custom JS
    $collection->add('../public/js/manager.js')->apply('JsMin');
    $collection->add('../public/js/pages.js')->apply('JsMin');
    $collection->add('../public/js/products.js')->apply('JsMin');
    $collection->add('../public/js/productcategories.js')->apply('JsMin');
    $collection->add('../public/js/productfiletypes.js')->apply('JsMin');
    $collection->add('../public/js/productimagetypes.js')->apply('JsMin');
    $collection->add('../public/js/projects.js')->apply('JsMin');

});

Basset::collection('ckeditor', function($collection)
{
    $collection->add("../public/ckeditor/ckeditor.js");
    $collection->add("../public/ckeditor/adapters/jquery.js");
})->raw();
*/